package com.example.mapper;

import com.example.entity.Worker;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface WorkerMapper {
    @Select("select * from worker where username=#{username} and password=#{password}")
    Worker findByUsernamePassword(Worker worker);

    List<Worker> selectByPage(String name);

    @Insert("insert into worker(username,worker_name,worker_salary,worker_sex,worker_age,entrydate,update_time,create_time,worker_category) value(#{username}," +
            "#{workerName},#{workerSalary},#{workerSex},#{workerAge},#{entrydate},#{updateTime},#{createTime},#{workerCategory})")
    void insert(Worker worker);
    void delete(List<Integer> ids);
@Select("select * from worker where worker_id=#{id}")
    Worker selectById(Integer id);

    void updata(Worker worker);
}
